package com.zx.map.service.impl;

import com.zx.map.dao.MerchantInfoDao;
import com.zx.map.dao.mapper.MerchantTokenAutoMapper;
import com.zx.map.dao.model.MerchantTokenAuto;
import com.zx.map.service.MerchantTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Component;

/**
 * Created by IntelliJ IDEA. User: Administrator Date: 14-12-10 Time: 涓嬪崍9:10 To
 * change this template use File | Settings | File Templates.
 */
@Component("MerchantTokenService")
public class MerchantTokenServiceImpl implements MerchantTokenService {

	@Autowired
	private MerchantTokenAutoMapper merchantTokenAutoMapper;

	@Override
	public MerchantTokenAuto getOneById(String merchantId) throws DataAccessException {
		return merchantTokenAutoMapper.selectByPrimaryKey(merchantId);
	}

	@Override
	public void add(MerchantTokenAuto auto) throws DataAccessException {
		merchantTokenAutoMapper.insert(auto);
	}

	@Override
	public void update(MerchantTokenAuto auto) throws DataAccessException {
		merchantTokenAutoMapper.updateByPrimaryKeySelective(auto);
	}
}
